using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using Yoozoo.UI;
public class YPrefabContainerBinderTreeItem : BindingBinderTreeItemBase
{
    public static Dictionary<YPrefabContainerBinder.AttributeType, LinkerValueState> AttributeValueDic = new Dictionary<YPrefabContainerBinder.AttributeType, LinkerValueState>
    {
        {YPrefabContainerBinder.AttributeType.offset, LinkerValueState.Vector3},
        {YPrefabContainerBinder.AttributeType.euler, LinkerValueState.Vector3},
        {YPrefabContainerBinder.AttributeType.scale, LinkerValueState.Vector3},
        {YPrefabContainerBinder.AttributeType.isAsync, LinkerValueState.Boolean},
        {YPrefabContainerBinder.AttributeType.layer, LinkerValueState.String},
        {YPrefabContainerBinder.AttributeType.parentName, LinkerValueState.String},
        {YPrefabContainerBinder.AttributeType.prefabName, LinkerValueState.String},
        {YPrefabContainerBinder.AttributeType.enabled, LinkerValueState.Boolean},
    };
    public YPrefabContainerBinderTreeItem() : base(typeof(YPrefabContainerBinder))
    {
    }
    
    public override void RebuildTree()
    {
        base.RebuildTree();
        foreach (YPrefabContainerBinder.AttributeType binderType in Enum.GetValues(typeof(YPrefabContainerBinder.AttributeType)))
        {
            BindingLinkerTreeItem linkerTreeItem = new BindingLinkerTreeItem(binderType.ToString(), binderType.ToString(), (int)AttributeValueDic[binderType]);
            AddChild(linkerTreeItem);
        }
    }
}